#!/usr/bin/python
"""
UDP Client for testing our UDP Server
"""
import socket, sys
def main():
	client_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

	while True:
		try:
			data = raw_input()
			client_socket.sendto(data, ("localhost", int(sys.argv[1])))
			print "%s -> %s" % (data, (client_socket.recvfrom(16))[0].rstrip())
		except:
			break

	client_socket.close()

if __name__ == '__main__':
	main()
